<%@ page import="java.util.Map" %>
<%@ page import="java.util.Arrays" %><%--
  Created by IntelliJ IDEA.
  User: dailyblue
  Date: 2025/7/15
  Time: 14:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<!--
 如何接受浏览器传递过来的内容 🌟🌟🌟🌟🌟🌟🌟
-->
<%
    // 必须在第一行输出
    request.setCharacterEncoding("utf-8");
    response.setCharacterEncoding("utf-8");
    // 会获取到某个参数的值（单个） username:参数名称
    String username = request.getParameter("username");
    String password = request.getParameter("password");
    String age = request.getParameter("age");
    // 会获取到数组元素
    String[] loves = request.getParameterValues("love");
    // 获取到所有值
    Map<String, String[]> all = request.getParameterMap();
    out.print("username:" + username + "<br/>");
    out.print("password:" + password + "<br/>");
    out.print("age:" + age + "<br/>");
    out.print("loves:" + Arrays.toString(loves) + "<br/>");
    out.print("all:" + all.keySet() + "<br/>");
    out.print("all:" + all.values() + "<br/>");
%>
</body>
</html>
